/**
 * GET 根据 code 获取枚举列表
 */
export const comboApi = {
    api: '/api/comp/selector/find_by_code',
    type: 'get'
};

/**
 * GET 查询查找器配置
 */
export const finderConfApi = {
    api: '/api/comp/finder/find_conf',
    type: 'get'
};

/**
 * POST 查询全局的业务数据
 */
export const queryApi = {
    api: '/api/data_query/query',
    type: 'post'
};

/**
 * POST 查询全局的业务数据
 */
export const queryAllApi = {
    api: '/api/data_query/query_all',
    type: 'post'
};

/**
 * GET 查询分类数据
 */
export const queryCateApi = {
    api: '/api/cate_data_query_service/query_cate_data',
    type: 'get'
};

/**
 * GET 获取异步任务的进度和结果
 * 返回的结果中，status <= 1 (执行中)。status === 2（执行成功）。status > 2 （执行失败）
 * 参数： {taskGroup: string, statusKey: string}
 */
export const taskResultApi = {
    api: '/api/async/prolonged_task/result',
    type: 'get'
};

/**
 * GET 查询异步任务错误信息
 * 参数： {statusKey: string, start: number, fetchSize: number}
 */
export const taskFailCauseApi = {
    api: '/api/async/prolonged_task/fail_cause',
    type: 'get'
};

/**
 * GET 按ID查找地址簿，并提取所有节点信息
 * 地址:/api/pub/addr/find_addr_book_by_id/{id}
 * @param id {number} 地址簿ID
 * @return {{id: number , code: string, name: string, country: {}}} 地址簿对象
 */
export const addrMsgApi = {
    api: '/api/pub/addr/find_addr_book_by_id',
    type: 'get'
};

/**
 * GET 根据指定节点关系创建地址,如果存在则返回数据库结果
 * 地址:/api/pub/addr/create_addr_book_if_not_exist
 * 参数:corp(公司),country(国家),province(省),city(城市),town(镇),street(街),area(区域),building(楼),unit(单元)
 * 返回:地址簿对象(id,code,name)
 */
export const addrCreateApi = {
    api: '/api/pub/addr/create_addr_book_if_not_exist',
    type: 'get'
};

/**
 * GET 根据父级 id 获取子列表
 * 地址:/api/pub/addr/find_part_by_parent
 * 参数:corp(公司),javaType(类型),parent(父节点ID,type为AddrCountry时传0)
 * 返回:地址信息对象(id,code,name)列表
 */
export const addrGetByParent = {
    api: '/api/pub/addr/find_part_by_parent',
    type: 'get'
};


/**
 * -------------------------流程按钮---------------------------------------------
 */

/**
 * GET 根据业务数据获取任务列表
 * 参数:appCode=VENDOR_PAYMENT&corp=DEVDEMO&dataId=83
 * 返回:{
  "status": 200,
  "data": [
    {
      "preTaskKey": "",
      "taskKey": "155007",
      "taskCode": "bpm89381cb6",
      "taskName": "申请",
      "status": "TREATED",
      "comments": "通过",
      "actionType": "TREATED",
      "actionName": "PASS",
      "id": 225,
      "version": 1,
      "corp": "DEVDEMO",
      "createInfo": {
        "userId": 2,
        "userName": "管理员",
        "addr": "0:0:0:0:0:0:0:1",
        "time": 1594105721
      },
      "updateInfo": {
        "userId": 2,
        "userName": "管理员",
        "addr": "0:0:0:0:0:0:0:1",
        "time": 1594106088
      }
    }
  ]}
 */
export const findTaskListByDataApi = {
    api: `/api/act/instance/find_task`,
    type: 'get'
};


export const findTaskByKeyApi = {
    api: `/api/act/instance/find_task_by_key`,
};

/**
 * 执行任务
 * params {actionName:string(流程名), actionType:string(流程类型), comments:string(备注), taskKey:string(任务KEY)}
 */
export const executeTaskApi = {
    api: `/api/act/instance/complete`,
    type: 'get'
};

/**
 * 查找流程驳回配置
 * params: {procDefKey:string(流程定义ID), taskCode:string(任务KEY)}
 */
export const findRejectConfApi = {
    api: `/api/act/instance/find_reject_conf`,
    type: 'get'
};

/**
 * 查询应用的扩展字段
 * params: {appCode:string(应用编码)}
 */
export const findExtendedEnableApi = {
    api: `/api/app_conf/app_ext/extend_enable`,
    type: 'get'
};

/**
 * 查询应用是否含有扩展字段
 * params: {appCode:string(应用编码)}
 */
export const findsExtendedApi = {
    api: `/api/app_conf/app_ext/query_ext`,
    type: 'get'
};

// 统一使用 appins.fetchTplContent 方法
/**
 * 查询应用界面模板
 * params: {language: string(语言), screen: string(尺寸), appCode: string(应用编码)}
 */
// export const findTemplateApi = {
//     api: `/api/app_conf/template/find_content`,
//     type: 'get'
// };

/**
 * 获取列表组件看板配置
 * @type {{api: string, type: string}}
 */
export const findKanbanConfApi = {
    api: `/api/fsm/kan_ban/find_conf`,
    type: 'get',
};

/**
 * 拖动看板切换状态
 * @type {{api: string, type: string}}
 */
export const changeKanbanStateApi = {
    api: `/api/fsm/kan_ban/change_state`,
    type: 'get',
};